#include<iostream>
#include<string>
#include<unistd.h>

using namespace std;

#include"Thread.hpp"

void* newthread(void* args)
{
    string s=static_cast<char*>(args);
    while(true)
    {
        cout<<"我是新线程："<<s<<endl;
        sleep(1);
    }
    return nullptr;
}

int main()
{
    Thread t1(newthread,(void*)"user1",1);
    Thread t2(newthread,(void*)"user2",2);
    Thread t3(newthread,(void*)"user3",3);

    t1.start();
    t2.start();
    t3.start();

    t1.join();
    t2.join();
    t3.join();

    return 0;
}